package br.inf.prismasoft.academix.entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * Disciplina generated by hbm2java
 */
@Entity
@Table(name = "DISCIPLINA", schema = "ACADEMIX")
public class Disciplina implements java.io.Serializable {

	private static final long serialVersionUID = -4985756019260566715L;
	private Integer idtDisciplina;
	private String codDisciplina;
	private String nomDisciplina;
	private String desDisciplina;
	private Set<Falta> faltas = new HashSet<Falta>(0);
	private Set<GradeHorariaItem> gradeHorariaItems = new HashSet<GradeHorariaItem>(
			0);
	private Set<DiscGradeCurricular> discGradeCurriculars = new HashSet<DiscGradeCurricular>(
			0);
	private Set<HistoricoItem> historicoItems = new HashSet<HistoricoItem>(0);
	private Set<Avaliacao> avaliacaos = new HashSet<Avaliacao>(0);

	public Disciplina() {
	}

	public Disciplina(String codDisciplina, String nomDisciplina) {
		this.codDisciplina = codDisciplina;
		this.nomDisciplina = nomDisciplina;
	}

	public Disciplina(String codDisciplina, String nomDisciplina,
			String desDisciplina, Set<Falta> faltas,
			Set<GradeHorariaItem> gradeHorariaItems,
			Set<DiscGradeCurricular> discGradeCurriculars,
			Set<HistoricoItem> historicoItems, Set<Avaliacao> avaliacaos) {
		this.codDisciplina = codDisciplina;
		this.nomDisciplina = nomDisciplina;
		this.desDisciplina = desDisciplina;
		this.faltas = faltas;
		this.gradeHorariaItems = gradeHorariaItems;
		this.discGradeCurriculars = discGradeCurriculars;
		this.historicoItems = historicoItems;
		this.avaliacaos = avaliacaos;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "idt_disciplina", unique = true, nullable = false)
	public Integer getIdtDisciplina() {
		return this.idtDisciplina;
	}

	public void setIdtDisciplina(Integer idtDisciplina) {
		this.idtDisciplina = idtDisciplina;
	}

	@Column(name = "cod_disciplina", nullable = false, length = 10)
	@NotNull
	@Length(max = 10)
	public String getCodDisciplina() {
		return this.codDisciplina;
	}

	public void setCodDisciplina(String codDisciplina) {
		this.codDisciplina = codDisciplina;
	}

	@Column(name = "nom_disciplina", nullable = false, length = 50)
	@NotNull
	@Length(max = 50)
	public String getNomDisciplina() {
		return this.nomDisciplina;
	}

	public void setNomDisciplina(String nomDisciplina) {
		this.nomDisciplina = nomDisciplina;
	}

	@Column(name = "des_disciplina", length = 100)
	@Length(max = 100)
	public String getDesDisciplina() {
		return this.desDisciplina;
	}

	public void setDesDisciplina(String desDisciplina) {
		this.desDisciplina = desDisciplina;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "disciplina")
	public Set<Falta> getFaltas() {
		return this.faltas;
	}

	public void setFaltas(Set<Falta> faltas) {
		this.faltas = faltas;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "disciplina")
	public Set<GradeHorariaItem> getGradeHorariaItems() {
		return this.gradeHorariaItems;
	}

	public void setGradeHorariaItems(Set<GradeHorariaItem> gradeHorariaItems) {
		this.gradeHorariaItems = gradeHorariaItems;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "disciplina")
	public Set<DiscGradeCurricular> getDiscGradeCurriculars() {
		return this.discGradeCurriculars;
	}

	public void setDiscGradeCurriculars(
			Set<DiscGradeCurricular> discGradeCurriculars) {
		this.discGradeCurriculars = discGradeCurriculars;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "disciplina")
	public Set<HistoricoItem> getHistoricoItems() {
		return this.historicoItems;
	}

	public void setHistoricoItems(Set<HistoricoItem> historicoItems) {
		this.historicoItems = historicoItems;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "disciplina")
	public Set<Avaliacao> getAvaliacaos() {
		return this.avaliacaos;
	}

	public void setAvaliacaos(Set<Avaliacao> avaliacaos) {
		this.avaliacaos = avaliacaos;
	}

}
